package top.zywork.enums;

import lombok.Getter;

/**
 * @author Animo
 * @Date 2020/10/18
 * @Blog http://www.ljyanimo.com
 */
@Getter
public enum CertificationTypeEnum {

    ONE_CARTOON(1,"一卡通"),
    STUDENT_ID_CARD(2,"学生证"),;

    private Integer code;

    private String value;

    CertificationTypeEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public static CertificationTypeEnum getEnum(Integer code){
        CertificationTypeEnum[] values = CertificationTypeEnum.values();
        for(CertificationTypeEnum certificationTypeEnum : values){
            if(certificationTypeEnum.getCode().equals(code)){
                return certificationTypeEnum;
            }
        }
        return null;
    }
}
